<template>
  <div>
    <v-album v-if="isShowPic" :id="data.id"></v-album>
    <div v-else :style="{height:data.windowHeight+'px'}">
      <v-salefullscreenitem v-if="JSON.stringify(data.detail) != '{}'" @receiveClickCollect="data.collect" @receiveClickBuy="data.skip" :item="data.detail" :windowHeight="data.windowHeight"></v-salefullscreenitem>
    </div>
    <v-backhome enter="saledetail"></v-backhome>
  </div>


</template>

<script>

  import utils from '../../utils'
  import { mapModules, mapRules } from 'vuet'

  export default {
    mixins: [
      mapModules({ data: 'saledetail'}),
      mapRules({need: [{ path: 'saledetail' }]}),
    ],

    data() {
      return {
        isShowPic:false
      }
    },


    beforeCreate(){

    },
    created() {

    },
    mounted() {
      var that = this
      this.data.needFetch = true
      window.addEventListener('hashchange', function() {
        if (window.location.href.indexOf("#viewpictures") != -1) {
          that.isShowPic = true
        } else {
          that.isShowPic = false
        }
      });
    },
    methods: {

    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>

</style>
